package com.sptpc.demo.repository;

import com.sptpc.demo.model.Order;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.time.LocalDate;
import java.util.List;

public interface OrderRepository extends JpaRepository<Order,Integer> {
    Page<Order> findOrdersByCreateTimeBetweenOrState(
            LocalDate start, LocalDate end, Integer state, Pageable pageable);

//    穷举所有搜索条件不可取
    List<Order> findOrdersByCustomer(String customer);
    List<Order> findOrdersByState(Integer state);
    List<Order> findOrdersByCustomerAndState(String customer,Integer state);


}
